package datastream.api.operator.multi.source.log;

import datastream.api.operator.multi.pojo.log.InputModel2;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.functions.source.SourceFunction;

import java.util.ArrayList;
import java.util.List;

public class InputModel2Source implements SourceFunction<InputModel2> {
    @Override
    public void run(SourceContext<InputModel2> ctx) throws Exception {
        ctx.collect(InputModel2.builder()
                .username("张三")
                .log(new Tuple2<String, String>("页面1", "按钮1"))
                .build());
        Thread.sleep(1000);

        ctx.collect(InputModel2.builder()
                .username("李四")
                .log(new Tuple2<String, String>("页面1", "按钮1"))
                .build());

    }

    @Override
    public void cancel() {

    }
}
